<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Video extends Model
{
    use HasFactory;

    protected $fillable = [
        'title',
        'image',
        'video',
        'type',
        'description',
        'expert_id',
        'start_at',
        'end_at',

    ];
    public function expert(){
        return $this->belongsToMany(Expert::class,'video_experts','video_id','expert_id');
    }
    public function experts(){
        return $this->belongsTo(Video::class,'expert_id','id');
    }

}
